﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Script.Serialization;

namespace olierFrm.Extensions.EString
{
    public static class JsonExtensions
    {
        public static string ToJSON(this object o)
        {
            return new JavaScriptSerializer().Serialize(o);
        }
        public static object ToJSON(this string strJson)
        {
            return new JavaScriptSerializer().DeserializeObject(strJson);
        }

        public static T ToJSON<T>(this string strJson)
        {
            return new JavaScriptSerializer().Deserialize<T>(strJson);
        }

    }
}